<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>
<%@ page import="jp.co.cos.ittrick.channel.model.ChannelModel" %>
<%@ page import="jp.co.cos.ittrick.channel.model.CategoryModel" %>
<%@ page import="jp.co.cos.ittrick.channel.model.ChapterModel" %>
<%@ page import="java.util.List" %>
<html lang="ja">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>${channelModel.name }：IT TRICK</title>
	<meta name="description" content="${channelModel.description }" />
	<meta name="keywords" content="${channelModel.keyWordListString}" />
	<link rel="icon" type="image/gif" href="/favicon.png" >
	<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss">
	<link href="/css/reset.css" rel="stylesheet" type="text/css" media="screen" />
	<link href="/css/common.css" rel="stylesheet" type="text/css" media="screen" />
	<link href="/css/channel.css" rel="stylesheet" type="text/css" media="screen" />
	<script src="/js/modernizr-1.1.min.js"></script>
</head>
<body>
<!--header-->
	<jsp:include page="/common/header.jsp" />
<!--/header-->

<!--pankuzuNav-->
	<nav id="pankuzuNav">
		<a href="/">${applicationModel.applicationName }</a>&nbsp;&nbsp;&gt;&nbsp;&nbsp;
			${channelModel.name }
	</nav>
<!--/pankuzuNav-->

<!-- contents -->
	<section id="contents" class="clear">
		<div id="contentsHeader">
			<div id="mainTopContent" class="clear">
				<article>
				<!-- 記事タイトル -->
				<h1>${channelModel.name }</h1>

				<!-- コンテンツ説明 -->
				${channelModel.contentString }
				</article>

				<!-- ソーシャルボタン -->
				<jsp:include page="/common/socialBtnList.jsp" />
			</div>

			<div id="mainTopAdvertisement">
				<!-- AdSense -->
				<jsp:include page="/common/adSense/text_image_300_250.jsp" />
				<!-- /AdSense -->
			</div>
		</div>

		<!-- mainContent -->
		<div id="mainContent">
			<div id="mainWrap">
				<div id="mainContentTopAdvertisement">
					<!-- AdSense -->
					<jsp:include page="/common/adSense/link_728_15.jsp" />
					<!-- /AdSense -->
				</div>

				<!-- 記事本文 -->
				<%
				ChannelModel channelModel = (ChannelModel)request.getAttribute("channelModel");
				List<CategoryModel> categoryList = channelModel.getCategoryModelListRef().getModelList();
				for(CategoryModel categoryModel: categoryList) {
				%>
				<nav class="articleMenu">
					<h3><%=categoryModel.getName() %></h3>
					<ul class="chapterlist">
						<%
						List<ChapterModel> chapterList = categoryModel.getChapterModelListRef().getModelList();
						for(ChapterModel chapterModel: chapterList) {
						%>
						<li class="navi">
							<%if(chapterModel.getPublicFlg()) { %>
								<a href="/<%=channelModel.getKeyString() %>/c<%=chapterModel.getKeyString() %>.html"><%=chapterModel.getName() %></a>
							<%}else { %>
								<%=chapterModel.getName() %>
							<%} %>
						</li>
						<%} %>
					</ul>
				</nav>
				<%} %>

				<div id="mainContentFooter">
					<!-- AdSense -->
					<jsp:include page="/common/adSense/text_image_728_90.jsp" />
					<!-- /AdSense -->
				</div>

				<!-- FaceBook Like Box -->
				<jsp:include page="/common/faceBookLikeBox.jsp" />
			</div>

			<aside id="rightWrap">

				<!-- profile -->
				<jsp:include page="/common/profile.jsp" />

				<div id="rightWrapAdvertisement300_600">
					<!-- AdSense -->
					<jsp:include page="/common/adSense/text_image_300_600.jsp" />
					<!-- /AdSense -->
				</div>

			</aside>
		</div>
	</section>
<!-- /contents -->

<!---footer-->
	<jsp:include page="/common/footer.jsp" />
<!--/footer-->

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/ja_JP/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</body>
</html>
